package stock.repositories;

import org.elasticsearch.search.SearchHits;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import stock.bean.Goods;

import java.util.List;

public interface ESGoodsRepository extends ElasticsearchRepository<Goods,String> {
    List<Goods> findByTitleOrPrice(String title,Double price);
    List<Goods> findByTitleAndPrice(String title,Double price);

    List<Goods> findByTitleOrCover(String title,String cover);

    List<Goods> findByTitle(String title);
    @Query("{\"match\":{\"title\":\"?0\"}}")
    List<Goods> find(String keyword);


}
